package ca.uvic.group2.api;

import java.io.Serializable;

public class PurchaseOrder implements Serializable {
    public static final int BUY = 0;
    public static final int SELL = 1;
    public static final int ADD_FUNDS = 2;

    public int kind;
    public Quote quote;
    public int amount;
    public Money total;
    public long expiry = System.currentTimeMillis() + 60000;

    /**
     * Used for SELL commands.  References the user's existing stock inventory.
     */
    public StockRecord existingInventory;

    public PurchaseOrder(int kind) {
        this.kind = kind;
    }

    public PurchaseOrder(PurchaseOrder src) {
        this.kind = src.kind;
        this.quote = new Quote(src.quote);
        this.amount = src.amount;
        this.total = src.total;
        this.expiry = src.expiry;
        this.existingInventory = src.existingInventory;
    }
}
